Login/ Register With Twitter

Course- PHP Tutorial >

Now a days most of the project required login through social media. This article will guide you to crate login/ register with twitter.

Step1:

Please insert the Following php script to your login/register page.

<?php
 if (array_key_exists("login", $_GET)) {
   $oauth_provider = $_GET['oauth_provider'];
     if ($oauth_provider == 'twitter') {
       header("Location: login-twitter.php");
     }
}
?>


Click here to generate App ID/API Key for Twitter.

Step 2:
Please insert login with twitter button and write down the following code.

<a href="?login&oauth_provider=twitter">
<img border="0" src="images/login_twitter.png" style="cursor:pointer"></a>

This will take user to twitter login page.

You can change your CONSUMER_KEY and CONSUMER_SECRET in twitter/twconfig.php file